package com.hk.quartz.job;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Author bigbeardhk
 * @Date 2020/12/14 14:43
 * @Email bigbeardhk@163.com
 */
public class MyJob_Dome1 implements Job {

    private final static Logger logger = LoggerFactory.getLogger(MyJob_Dome1.class);


    private void before(){
        System.out.println("任务开始执行之前");
    }


    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        before();
        System.out.println("开始："+System.currentTimeMillis());
        // TODO 业务
        logger.warn("定时任务正在执行!!!");
        System.out.println("结束："+System.currentTimeMillis());
        after();
    }


    private void after(){
        System.out.println("任务执行结束之后");
    }

}
